import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'


//静态路由表
export const constantRouterMap = [
  {path: '/index', name: 'Index', meta: {title: "网站首页"}, component: () => import('@/front/Index.vue')},
  {path:'/front/newList/:id', name:'NewList', meta: {title: "新闻咨询列表"}, component:()=>import('@/front/NewList')},
  {path:'/front/newDetail/:id', name:'NewDetail', meta: {title: "新闻咨询详情"}, component:()=>import('@/front/NewDetail')},
  {path:'/front/postList/', name:'PostList', meta: {title: "职位信息集合"}, component:()=>import('@/front/PostList')},
  {path:'/front/companyList/', name:'CompanyList', meta: {title: "公司信息集合"}, component:()=>import('@/front/CompanyList')},
  {path:'/front/companyDetail/:id', name:'CompanyDetail', meta: {title: "公司信息详情"}, component:()=>import('@/front/CompanyDetail')},
  {path:'/front/companyRegister/', name:'CompanyRegister', meta: {title: "公司进行注册"}, component:()=>import('@/front/CompanyRegister')},
  {path:'/front/postListByOrder', name:'postListByOrder', meta: {title: "分类的职位信息集合"}, component:()=>import('@/front/jms/allpostlist/index')},
  {path:'/front/postdetail/:id', name:'postdetail', meta: {title: "职位详情"}, component:()=>import('@/front/jms/allpostlist/postdetail')},
  {path: '/login', component: () => import('@/views/login/index'), hidden: true},
  {path: '/404', component: () => import('@/views/404'), hidden: true},
  {path: '', component: Layout, redirect: '/home',
    children: [{
      path: 'home',
      name: 'home',
      component: () => import('@/views/home/index'),
      meta: {title: '首页', icon: 'home'}
    }]
  }
]

//动态路由表
export const asyncRouterMap = [
  //权限模块
  {
    path:'/ums',
    component: Layout,
    redirect: '/ums/admin',
    name: 'ums',
    meta: {title: '权限', icon: 'ums'},
    children: [
      {
        path: 'admin',
        name: 'admin',
        component: () => import('@/views/ums/admin/index'),
        meta: {title: '用户管理', icon: 'ums-admin'}
      },
      {
        path: 'role',
        name: 'role',
        component: () => import('@/views/ums/role/index'),
        meta: {title: '角色管理', icon: 'ums-role'}
      },
      {
        path: 'allocMenu',
        name: 'allocMenu',
        component: () => import('@/views/ums/role/allocMenu'),
        meta: {title: '分配菜单'},
        hidden: true
      },
      {
        path: 'allocResource',
        name: 'allocResource',
        component: () => import('@/views/ums/role/allocResource'),
        meta: {title: '分配资源'},
        hidden: true
      },
      {
        path: 'menu',
        name: 'menu',
        component: () => import('@/views/ums/menu/index'),
        meta: {title: '菜单管理', icon: 'ums-menu'}
      },
      {
        path: 'addMenu',
        name: 'addMenu',
        component: () => import('@/views/ums/menu/add'),
        meta: {title: '添加菜单'},
        hidden: true
      },
      {
        path: 'updateMenu',
        name: 'updateMenu',
        component: () => import('@/views/ums/menu/update'),
        meta: {title: '修改菜单'},
        hidden: true
      },
      {
        path: 'resource',
        name: 'resource',
        component: () => import('@/views/ums/resource/index'),
        meta: {title: '资源列表', icon: 'ums-resource'}
      },
      {
        path: 'resourceCategory',
        name: 'resourceCategory',
        component: () => import('@/views/ums/resource/categoryList'),
        meta: {title: '资源分类'},
        hidden: true
      },
      {
        path: 'dict',
        name: 'dict',
        component: () => import('@/views/ums/dict/index'),
        meta: {title: '数据字典'},
        hidden: true
      }
    ]
  },
  //就业模块
  {
    path:'/jms',
    component: Layout,
    redirect: '/jms/studentlist',
    name: 'jms',
    meta: {title: '就业模块', icon: 'ums'},
    children: [
      {
        path: 'studentlist',
        name: 'studentlist',
        component: () => import('@/views/jms/studentlist/index'),
        meta: {title: '学生管理', icon: 'ums-admin'}
      },
      {
        path: 'companylist',
        name: 'companylist',
        component: () => import('@/views/jms/companylist/index'),
        meta: {title: '公司审核', icon: 'ums-role'}
      },
      {
        path: 'allpostlist',
        name: 'allpostlist',
        component: () => import('@/views/jms/allpostlist/index'),
        meta: {title: '职位管理'},
        hidden: true
      },
      {
        path: 'professionlist',
        name: 'professionlist',
        component: () => import('@/views/jms/professionlist/index'),
        meta: {title: '专业管理'},
        hidden: true
      },
      {
        path: 'companyinschool',
        name: 'companyinschool',
        component: () => import('@/views/jms/companyinschool/index'),
        meta: {title: '驻校企业管理'},
        hidden: true
      },
    ]
  },
  //咨询模块
  {
    path:'/nms',
    component: Layout,
    redirect: '/nms/channelist',
    name: 'nms',
    meta: {title: '咨询模块', icon: 'ums'},
    children: [
      {
        path: 'channelist',
        name: 'channelist',
        component: () => import('@/views/nms/channelist/index'),
        meta: {title: '咨询栏目管理', icon: 'ums-admin'}
      },
      {
        path: 'articlelist',
        name: 'articlelist',
        component: () => import('@/views/nms/articlelist/index'),
        meta: {title: '咨询管理', icon: 'ums-role'}
      },
      {
        path: 'attachmentlist',
        name: 'attachmentlist',
        component: () => import('@/views/nms/attachmentlist/index'),
        meta: {title: '咨询附件管理'},
        hidden: true
      },
    ]
  },
  //招聘模块
  {
    path:'/pms',
    component: Layout,
    redirect: '/pms/postlist',
    name: 'pms',
    meta: {title: '招聘模块', icon: 'ums'},
    children: [
      {
        path: 'companyinfo',
        name: 'companyinfo',
        component: () => import('@/views/pms/companyinfo/index'),
        meta: {title: '公司信息'},
        hidden: true
      },
      {
        path: 'postlist',
        name: 'postlist',
        component: () => import('@/views/pms/postlist/index'),
        meta: {title: '公司职位管理', icon: 'ums-admin'}
      },
      {
        path: 'studentinfo',
        name: 'studentinfo',
        component: () => import('@/views/pms/studentinfo/index'),
        meta: {title: '个人信息', icon: 'ums-admin'}
      },
      {
        path: 'studentresume',
        name: 'studentresume',
        component: () => import('@/views/pms/studentresume/index'),
        meta: {title: '个人简历', icon: 'ums-admin'}
      },
      {
        path: 'favorcompany',
        name: 'favorcompany',
        component: () => import('@/views/pms/favorcompany/index'),
        meta: {title: '我收藏的公司', icon: 'ums-admin'}
      },
      {
        path: 'favorpost',
        name: 'favorpost',
        component: () => import('@/views/pms/favorpost/index'),
        meta: {title: '我收藏的职位', icon: 'ums-admin'}
      },
      {
        path: 'mysend',
        name: 'mysend',
        component: () => import('@/views/pms/mysend/index'),
        meta: {title: '我的投递情况', icon: 'ums-admin'}
      },
      {
        path: 'sendlist',
        name: 'sendlist',
        component: () => import('@/views/pms/sendlist/index'),
        meta: {title: '简历筛选管理', icon: 'ums-admin'}
      },
      {
        path: 'passlist',
        name: 'passlist',
        component: () => import('@/views/pms/passlist/index'),
        meta: {title: '面试人员管理', icon: 'ums-admin'}
      },

    ]
  },
  //简历模块
  {
    path:'/rms',
    component: Layout,
    redirect: '/rms/certificate',
    name: 'rms',
    meta: {title: '招聘模块', icon: 'ums'},
    children: [
      {
        path: 'certificate',
        name: 'certificate',
        component: () => import('@/views/rms/certificate/index'),
        meta: {title: '荣誉证书', icon: 'ums-admin'}
      },
      {
        path: 'intention',
        name: 'intention',
        component: () => import('@/views/rms/intention/index'),
        meta: {title: '求职意向'},
        hidden: true
      },
      {
        path: 'project',
        name: 'project',
        component: () => import('@/views/rms/project/index'),
        meta: {title: '项目经历'},
        hidden: true
      },
      {
        path: 'studentcadre',
        name: 'studentcadre',
        component: () => import('@/views/rms/studentcadre/index'),
        meta: {title: '学生干部'},
        hidden: true
      },
      {
        path: 'train',
        name: 'train',
        component: () => import('@/views/rms/train/index'),
        meta: {title: '培训经历'},
        hidden: true
      },
      {
        path: 'experience',
        name: 'experience',
        component: () => import('@/views/rms/experience/index'),
        meta: {title: '项目经历'},
        hidden: true
      },
    ]
  },


  {path: '*', redirect: '/404', hidden: true}
]

export default new Router({
   mode: 'history', //后端支持可开
  scrollBehavior: () => ({y: 0}),
  routes: constantRouterMap
})

